package com.jn.exam.easypoi.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 江南大学1033190417
 * @date 2022/1/17 21:32
 */
@Component
@FeignClient(value = "service-oss")
public interface OssFeignService {

    @PostMapping(value = "/examoss/fileoss/uploadFile",consumes = "multipart/form-data")
    @ResponseBody
    public String uploadOssFile(MultipartFile file);

    @PostMapping("/examoss/fileoss/deleteFileByUrl")
    @ResponseBody
    public boolean deleteFileByUrl(@RequestParam("url") String url);

    @PostMapping("/examoss/fileoss/uploadFileByByte")
    @ResponseBody
    public String uploadOssFile(@RequestBody byte[] bytes);
}
